
import yaml
import os

def get_path(filename):
    root_path =os.path.dirname(os.path.dirname(__file__))
    new_path = os.path.join(root_path, "datas", filename)
    return new_path

def read_yaml(filename):
    ###读取yaml文件的内容
    with open(get_path(filename),'r',encoding='utf-8') as f:
        return yaml.safe_load(f)

##调试代码
if __name__=="__main__":
    res =read_yaml("login.yaml")
    print(type(res))
    print(res)

